/*
 * Sprite.h
 *
 *  Created on: 14 jan 2010
 *      Author: Andreas
 */

#ifndef SPRITE_H_
#define SPRITE_H_

#include <string>
#include <SDL/SDL.h>
#include "SDL/SDL_opengl.h"
#include "SpriteAnimation.h"
#include "Image.h"


using namespace std;

class Sprite : public Image {
public:
	Sprite();
	Sprite(string file);
	virtual ~Sprite();

	void draw();
	void loadAnimation(int rows, int cols, int frametime);
	void move(float dx, float dy);
	void setSpeed(float dx, float dy);
	void updatePos();
	void updateSpeed(double a, double s);

	float getDx() { return dx; }
	float getDy() { return dy; }

	SpriteAnimation *getAnimation();

protected:
	float dx,dy;
	static const float PI=3.1415926532;
	SpriteAnimation *animation;
};

#endif /* SPRITE_H_ */
